package com.herui.iot.ui.view.ecg.animation;

import android.animation.TypeEvaluator;

import com.herui.sport_care.ui.view.ecg.bean.Point;


/**
 * Created by amanda.shan on 2017/1/12.
 */

public class PointEvaluator implements TypeEvaluator {

    @Override
    public Object evaluate(float fraction, Object startValue, Object endValue) {
        Point startPoint = (Point) startValue;
        Point endPoint = (Point) endValue;
        float x = startPoint.getX() + fraction * (endPoint.getX() - startPoint.getX());

        float y = startPoint.getY() + fraction * (endPoint.getY() - startPoint.getY());
        Point point = new Point(x, y);
        return point;
    }
}
